package com.o2o.model.topic;

import java.util.Date;

import org.springframework.stereotype.Component;

import com.o2o.util.TimeUtil;

@Component
public class Product extends Topic {
	/**
	 * 主题帖产品类
	 */
	private static final long serialVersionUID = 7525158978271542604L;
	
	private long id;
	
	private String productName;
	
	private float productMarketPrice;//产品市场价格
	
	private String productDescription;// 产品描述
	
	private long productCreateTime;//上传时间
	
	private String productUrl;//产品的网链
	
	private int productStatus;//产品状态，1为正常，0为删除
	
	private int productType;//产品类型，2为本地生活服务类，1为全新标准商品，3为二手商品
	
	private int productCategoryNumber;//产品分类编码number，不是id。对应category实体中number编码字段
	
	private String productBrand;//产品品牌
	
	private String productMainPicture;//商品主图
	
	private int productSaleNum;//产品购买人数
	
	private int productGrade;//商品评分
	
	private Topic topic;
	
	private long uid;
	
	public Product() {
		super();
	}
	/**
	 * 获取商品创建时间
	 * @return
	 */
	public Date getProductCreateDate(){
		return TimeUtil.GetDateTimeByStamp(this.productCreateTime*1000);
	}

	public Topic getTopic() {
		return topic;
	}
	public void setTopic(Topic topic) {
		this.topic = topic;
	}
	public long getUid() {
		return uid;
	}
	public void setUid(long uid) {
		this.uid = uid;
	}
	public int getProductGrade() {
		return productGrade;
	}




	public void setProductGrade(int productGrade) {
		this.productGrade = productGrade;
	}




	public int getProductSaleNum() {
		return productSaleNum;
	}




	public void setProductSaleNum(int productSaleNum) {
		this.productSaleNum = productSaleNum;
	}




	public long getId() {
		return id;
	}




	public void setId(long id) {
		this.id = id;
	}




	public String getProductName() {
		return productName;
	}




	public void setProductName(String productName) {
		this.productName = productName;
	}




	public float getProductMarketPrice() {
		return productMarketPrice;
	}




	public void setProductMarketPrice(float productMarketPrice) {
		this.productMarketPrice = productMarketPrice;
	}




	public String getProductDescription() {
		return productDescription;
	}




	public void setProductDescription(String productDescription) {
		this.productDescription = productDescription;
	}




	




	public long getProductCreateTime() {
		return productCreateTime;
	}




	public void setProductCreateTime(long productCreateTime) {
		this.productCreateTime = productCreateTime;
	}




	public String getProductUrl() {
		return productUrl;
	}




	public void setProductUrl(String productUrl) {
		this.productUrl = productUrl;
	}




	public int getProductStatus() {
		return productStatus;
	}




	public void setProductStatus(int productStatus) {
		this.productStatus = productStatus;
	}




	public int getProductType() {
		return productType;
	}




	public void setProductType(int productType) {
		this.productType = productType;
	}




	public int getProductCategoryNumber() {
		return productCategoryNumber;
	}




	public void setProductCategoryNumber(int productCategoryNumber) {
		this.productCategoryNumber = productCategoryNumber;
	}




	public String getProductBrand() {
		return productBrand;
	}




	public void setProductBrand(String productBrand) {
		this.productBrand = productBrand;
	}




	public String getProductMainPicture() {
		return productMainPicture;
	}




	public void setProductMainPicture(String productMainPicture) {
		this.productMainPicture = productMainPicture;
	}


	public Product(long id, String productName, float productMarketPrice,
			String productDescription, long productCreateTime,
			String productUrl, int productStatus, int productType,
			int productCategoryNumber, String productBrand,
			String productMainPicture, int productSaleNum, int productGrade,
			long uid) {
		this.id = id;
		this.productName = productName;
		this.productMarketPrice = productMarketPrice;
		this.productDescription = productDescription;
		this.productCreateTime = productCreateTime;
		this.productUrl = productUrl;
		this.productStatus = productStatus;
		this.productType = productType;
		this.productCategoryNumber = productCategoryNumber;
		this.productBrand = productBrand;
		this.productMainPicture = productMainPicture;
		this.productSaleNum = productSaleNum;
		this.productGrade = productGrade;
		this.uid = uid;
	}
	@Override
	public String toString() {
		return "Product [id=" + id + ", productName=" + productName
				+ ", productMarketPrice=" + productMarketPrice
				+ ", productDescription=" + productDescription
				+ ", productCreateTime=" + productCreateTime + ", productUrl="
				+ productUrl + ", productStatus=" + productStatus
				+ ", productType=" + productType + ", productCategoryNumber="
				+ productCategoryNumber + ", productBrand=" + productBrand
				+ ", productMainPicture=" + productMainPicture
				+ ", productSaleNum=" + productSaleNum + ", productGrade="
				+ productGrade + ", uid=" + uid + "]";
	}
	

	
	
}
